package main

import (
	"com.lh.basic.service/config"
	"com.lh.basic.service/entry"
	"com.lh.basic.service/locale"
	"log"
	"runtime"
	"strings"
	"sync"
)

func main() {
	_, path, _, ok := runtime.Caller(0)
	if !ok {
		log.Printf("很抱歉，程序运行错误")
		return
	}
	path = strings.Replace(path, "\\", "/", 10)
	path = strings.Replace(path, "/main.go", "", 10)
	locale.Init(path)
	serve, err := config.Init(path, "basic")
	if err != nil {
		log.Printf("配置文件：%v", err)
		return
	}
	var wg sync.WaitGroup
	wg.Add(3)
	go entry.InitGrpc(serve, &wg)
	go entry.InitGateway(serve, &wg)
	go entry.InitGrpcWeb(serve, &wg)
	wg.Wait()
}
